package com.controll;

import java.util.Map;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.obj.NewsInfo;


@Controller("userController")
@RequestMapping("/testControll")
public class TestController {
	@RequestMapping("login")
    public String login() throws Exception {
        System.out.println("*****进入后台******");
        return "main";
    }
	public void initUserContext(Map<String, String> fupinInfo){
		Session session = SecurityUtils.getSubject().getSession();
		session.setAttribute("session_userId", fupinInfo.get("userId"));
		session.setAttribute("session_telnum", fupinInfo.get("telnum"));
	}
	@RequestMapping("/saveInfo")
    public String saveInfo(NewsInfo newsInfo) throws Exception {
        System.out.println("*****进入后台*参数保存*****");
        System.err.println("****文章标题***"+newsInfo.getNewsNm());
        System.err.println("****简略标题***"+newsInfo.getNewsDesc());
       return "success";
    }
}
